<script setup>
import Router from "@/router";

const router = Router;
const goBack = () => {
	router.go(-1);
}
</script>

<template>
	<div class="nav-bar">
		<div class="left" @click="goBack">
			<slot name="left">
				<img alt="" src="@/assets/images/left.png">
			</slot>
		</div>
		<div class="center">
			<slot></slot>
		</div>
		<div class="right">
			<slot name="right"></slot>
		</div>
	</div>
</template>

<style lang="scss" scoped>
.nav-bar {
	width: 100%;
	display: flex;
	background-color: var(--color-tint);
	color: #FFFFFF;
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 999;
	height: 45px;
	line-height: 45px;
	text-align: center;
	box-shadow: 0 2px 0 rgba(100, 100, 100, .1);
}

.left, .right {
	width: 60px;
}

.left img {
	width: 45px;
	padding: 12px;
}

.center {
	flex: 1;
}
</style>